1. Technical Field
The present invention relates generally to an improved data processing system and in particular to a method and an apparatus for supporting multiple operating systems. Still more particularly, the present invention provides a method to allow multiple operating systems resident on the same physical disk to run on different computers at the same time.
2. Description of Related Art
Loading and running an operating system (OS) is accomplished by using a bootstrap program. Normally, starting the operating system is a two step process involving a xe2x80x9csimplexe2x80x9d boot program that determines which operating system to load and a more complex boot program that actually loads the selected operating system. The simple boot program, usually stored in nonvolatile system RAM (NVRAM), is used to perform system resource initialization. Specifically, the simple boot program initializes registers in the Central Processing Unit (CPU) and initializes device controllers, such as controllers for the system disk and memory. The simple boot program can read and write to memory and can load from a boot block on the system disk. The boot block contains the master boot record (MBR) and is located at sector 0 of the system disk drive.
The master boot record (MBR) is loaded from the system disk and contains a partition table and some executable code. The master boot record executable code scans the partition table for a single active partition, loads the first sector from the active partition into memory, and executes this code, which is the boot code for the selected operating system. This operating system boot code loads the operating system that is being booted and starts the operating system in a defined manner.
If a hard disk contains, for example, an MS-DOS partition, a LINUX partition, a Windows NT partition, and an IBM OS/2 partition, a user can change which of these systems will be started by changing the active partition. The active partition may be set by storing this information in nonvolatile system RAM (NVRAM). Normally the last operating system installed on the system disk drive updates the NVRAM so that this operating system will be booted. But an operating system can provide a utility program that allows a different operating system to be designated as the active partition in NVRAM. This then allows the next reboot to boot to a different operating system.
Although the above method allow the user to select an operating system to be booted at system startup, this method does not allow two or more operating systems on different machines to run at the same time from the same system disk. Thus, any machine making use of a shared system disk having, for example, an OS/2 partition as the active partition must itself run under the OS/2 operating system. This limits the versatility of the system and places restrictions on the system resources, such as the type of file system, that can be accessed. Therefore, it would be advantageous to have a method and a system for accessing a shared system resource, such as a system disk drive, so that different machines may run different operating systems and access appropriate system resources at the same time.
The present invention provides a method and system for running, on different computers at the same time, multiple operating systems from the same shared system resource. This is accomplished, for example, by using persistent elemental disk reservations. Each machine reads the master boot record without reservation to determine the partition of the operating system to be booted. Each machine then makes an elemental exclusive write persistent reservation for accessing the operating system boot partition. This is followed by each machine making another elemental exclusive write persistent reservation for accessing the operating system partition itself. Each machine is assigned a different operating system partition even if they are running the same operating system. The unique reservation key for these reservations is created from at least on of a Processor ID, a Cluster ID, a Multiple Processor partition ID, a Non-Uniform Memory Access complex ID, and/or a Non-Uniform Memory Access node ID.